package find.prj.prog;

import java.util.ArrayList;

import find.prj.lib.Graph;
import find.prj.lib.GraphRoute;

public class ConsoleGraphTest {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
			String fileName = System.getProperty("user.dir") + "\\TestingFiles\\GraphTest.txt";
			Graph graph = new Graph();
			graph.LoadConnectivityMatrixFromFile(fileName, false);
			String s = graph.getConnectivityMatrixtoString(true);
			System.out.println(s + "\n\n");
			ArrayList<GraphRoute> routes = graph.getAllRoutes(10, 15);
			for (GraphRoute route : routes)
				System.out.println(route.toString());
			System.out.println("***************");
			System.out.println("Shortest route by exhaustive search:\n" + graph.getShortestRouteByExhaustiveSearch(10, 15).toString());
			System.out.println("***************");
			System.out.println("Shortest route by Dijkstra algorythm:\n" + graph.getShortestRouteByDijkstra(10, 15).toString());
			graph.SaveConnectivityMatrixToCSV(System.getProperty("user.dir")+"\\TestingFiles\\graph.csv", true);
	}
}